<template>
	<div class="" style="width: 100%;">
		<head-top></head-top>


	
		<div class="table_container" :style="'width: 90%;  overflow: hidden;  height:700px;'">
			<div style="margin: 5px; display: flex;">
				<span style="font-size: 20px;width: 100px;">业绩拆分 :  </span>
				

				<!-- <span style="font-size: medium; padding: 10px;">日期:</span>
				<el-select v-model="date_choice" size="small" clearable filterable placeholder="请选择"
					@change="get_exchange_arrange()">
					<el-option v-for="item in date_options" :key="item.label" :label="item.label"
						:value="item.value">
					</el-option>
				</el-select> -->
				
				
				<span style="font-size: medium; padding: 10px;">开始日期:</span>
				<el-select v-model="date_choice_begin" size="small" clearable filterable placeholder="请选择">
					<el-option v-for="item in date_options" :key="item.label" :label="item.label"
						:value="item.value">
					</el-option>
				</el-select>
				<span style="font-size: medium; padding: 10px;">结束日期:</span>
				<el-select v-model="date_choice_end" size="small" clearable filterable placeholder="请选择">
					<el-option v-for="item in date_options" :key="item.label" :label="item.label"
						:value="item.value">
					</el-option>
				</el-select>
				<span style="font-size: medium; padding: 10px;">product_name:</span>
				<el-select v-model="product_choice" size="small" clearable filterable placeholder="请选择"
					@change="get_exchange_arrange()">
					<el-option v-for="item in product_options" :key="item.label" :label="item.label"
						:value="item.value">
					</el-option>
				</el-select>
				<div>
					<el-button size="mini" type="success" @click="get_exchange_arrange()">刷新</el-button>
					
				</div>
				
				<!-- <div>
					<el-button size="mini" type="success" style="margin-left: 20px;" @click="send_xls()">发送预估xls</el-button>
					
				</div> -->
			</div>

			<el-table ref="singleTable" :data="arrange_data" height="600px" border size='small' :fit='true' show-summary
				:style="'width:'+(screenWidth*1.0)+'px;'" :row-class-name=" tableRowClassNamemoneyout"  @selection-change="handleSelectionChange">
				
		
				
		     	<el-table-column  type="index" label="ID"  width="50"></el-table-column>
				<el-table-column prop="date_str" label="日期"  sortable  align></el-table-column>
				<el-table-column prop="product_name" label="产品名称"  sortable  align></el-table-column>
				<el-table-column prop="product_properties" label="产品属性"  sortable  align></el-table-column>
				<el-table-column prop="zcjz_sum" label="资产净值"  sortable  align></el-table-column>
				<el-table-column prop="long_exposure" label="多头暴露"  sortable  align></el-table-column>
				<el-table-column prop="product_total_increase_per" label="预估涨幅"  sortable  align></el-table-column>
				<el-table-column prop="ljdwjz_increase_per" label="真实涨幅"  sortable  align></el-table-column>
				
				<el-table-column  prop="difference"  label="差异"  sortable  align>	</el-table-column>
				
				
				<el-table-column prop="index_increase" label="指数数据"  sortable  align></el-table-column>
				<el-table-column prop="money_use_per" label="资金利用率"  sortable  align></el-table-column>
				 
				<el-table-column prop="bond_increase_per" label="bond涨幅"  sortable  align>
					<template slot-scope="scope">
						<span style="color:red ">  {{ scope.row.bond_increase_per }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="cffex_increase_per" label="cffex涨幅"   align>
					<template slot-scope="scope">
						<span style="color:red ">  {{ scope.row.cffex_increase_per }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="commodity_increase_per" label="商品涨幅"   sortable  align>
					<template slot-scope="scope">
						<span style="color:red ">  {{ scope.row.commodity_increase_per }}</span>
					</template>
				</el-table-column> 
				
				<el-table-column prop="stock_increase_per" label="股票涨幅"    align>
					<template slot-scope="scope">
						<span style="color:red ">  {{ scope.row.stock_increase_per }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="future_increase_per" label="期货涨幅"     align>
					<template slot-scope="scope">
						<span style="color:red ">  {{ scope.row.future_increase_per }}</span>
					</template>
				</el-table-column>
			
				<el-table-column prop="bond_proportion" label="bond占比"  sortable  align></el-table-column>
				<el-table-column prop="cffex_proportion" label="cffex占比"   align></el-table-column>
				<el-table-column prop="commodity_proportion" label="商品占比"   sortable  align></el-table-column> 
				<el-table-column prop="stock_proportion" label="股票占比"    align></el-table-column>
				<el-table-column prop="future_proportion" label="期货占比"     align></el-table-column>
				
				
				<!-- <el-table-column prop="progress" label="进程"   sortable  width="200"  align></el-table-column>
				<el-table-column prop="log" label="备注"     width="400"  align></el-table-column>
				<el-table-column prop="necessery_task" label="必要任务"  width="200"   sortable  align></el-table-column>
				<el-table-column prop="importance" label="优先级"  width="200"   sortable  align></el- -->table-column>
				
				<el-table-column label="操作" :width='90'>
					<template slot-scope="scope">
						<el-button size="mini" type="primary" @click="handlefixaccount(scope.$index, scope.row,'binary')">修改
						</el-button>
						<!-- <el-button size="small" type="warning" @click="change_configindex(scope.$index, scope.row)">详情</el-button> -->
					</template>
				</el-table-column>
		
			</el-table>

		</div>
		
		<div class="table_container" :style="'width: 90%;  overflow: hidden;  height:600px;'">
			<div style="margin: 5px; display: flex;">
				<span style="font-size: 20px;width: 100px;">业绩汇总 :  </span>
			
		
				<span style="font-size: medium; padding: 10px;">开始日期:</span>
				<el-select v-model="date_choice_begin" size="small" clearable filterable placeholder="请选择">
					<el-option v-for="item in date_options" :key="item.label" :label="item.label"
						:value="item.value">
					</el-option>
				</el-select>
				<span style="font-size: medium; padding: 10px;">结束日期:</span>
				<el-select v-model="date_choice_end" size="small" clearable filterable placeholder="请选择">
					<el-option v-for="item in date_options" :key="item.label" :label="item.label"
						:value="item.value">
					</el-option>
				</el-select>
				<span style="font-size: medium; padding: 10px;">product_name:</span>
				<el-select v-model="product_choice_list" size="small" multiple filterable placeholder="请选择"
					@change="get_exchange_arrange()">
					<el-option v-for="item in product_options" :key="item.label" :label="item.label"
						:value="item.value">
					</el-option>
				</el-select>
				<div style="padding-left: 10px;">
					<el-button  size="mini" type="success" @click="get_exchange_arrange1()">刷新</el-button>
					
				</div>
				
			</div>
		
			<el-table ref="singleTable" :data="arrange_data1" height="600px" border size='small' :fit='true'
				:style="'width:'+(screenWidth*1.0)+'px;'"  @selection-change="handleSelectionChange">
				
		
				
		     	<el-table-column  type="index" label="ID"  width="50"></el-table-column>
				<el-table-column prop="product_name" label="产品名称"  sortable  align></el-table-column>
				<el-table-column prop="product_properties" label="产品属性"  sortable  align></el-table-column>
				
				 
				<el-table-column prop="bond_increase_per" label="bond涨幅"  sortable  align></el-table-column>
				<el-table-column prop="cffex_increase_per" label="cffex涨幅"   align></el-table-column>
				<el-table-column prop="commodity_increase_per" label="商品涨幅"   sortable  align></el-table-column> 
				<el-table-column prop="stock_increase_per" label="股票涨幅"    align></el-table-column>
				<el-table-column prop="future_increase_per" label="期货涨幅"     align></el-table-column>
			
				<el-table-column prop="bond_increase" label="bond_pnl"  sortable  align></el-table-column>
				<el-table-column prop="cffex_increase" label="cffex_pnl"   align></el-table-column>
				<el-table-column prop="commodity_increase" label="商品_pnl"   sortable  align></el-table-column> 
				<el-table-column prop="stock_increase" label="股票_pnl"    align></el-table-column>
				<el-table-column prop="future_increase" label="期货_pnl"     align></el-table-column>
				
				
				<!-- <el-table-column prop="progress" label="进程"   sortable  width="200"  align></el-table-column>
				<el-table-column prop="log" label="备注"     width="400"  align></el-table-column>
				<el-table-column prop="necessery_task" label="必要任务"  width="200"   sortable  align></el-table-column>
				<el-table-column prop="importance" label="优先级"  width="200"   sortable  align></el- -->table-column>
				<!-- 
				<el-table-column label="操作" :width='90'>
					<template slot-scope="scope">
						<el-button size="mini" type="primary" @click="handlefixaccount(scope.$index, scope.row,'binary')">修改
						</el-button>
					</template>
				</el-table-column> -->
		
			</el-table>
		
		</div>
		
		
		<el-dialog :visible.sync="visible2">
			<div style="display: flex;flex-flow: column; justify-content:center;">
				<div style="display: flex; justify-content:center;">
					<span style="color: orange;font-size: 24px; font-family: KaiTi, Helvetica, sans-serif;">修改产品 {{fix_account['product_name']}}</span>
				</div>
				<div style="display: flex;flex-flow:row; ">
					<div style="width: 100%; height: 500px;overflow-y: scroll;">
						
						
						
						<div style="display: flex;align-items: center;center;padding-top: 20px; justify-content:center;">
							<span style="width: 20%; ">bond_increase_per：</span>
							<el-input v-model="fix_account['bond_increase_per']" size="small" style="width: 20%;"placeholder="bond_increase_per"></el-input>
							<span style="width: 20%; padding-left: 5%;">bond_increase：</span>
							<el-input v-model="fix_account['bond_increase']" size="small" style="width: 20%;"placeholder="bond_increase_per"></el-input>
							<span style="width: 10%; padding-left: 5%; color: orange;">{{fix_account['bond_proportion']}}%</span>
						</div>
						<div style="display: flex;align-items: center;center;padding-top: 20px; justify-content:center;">
							<span style="width: 20%;">cffex_increase_per：</span>
							<el-input v-model="fix_account['cffex_increase_per']" size="small" style="width: 20%;"placeholder="cffex_increase_per"></el-input>
							<span style="width: 20%; padding-left: 5%;">cffex_increase：</span>
							<el-input v-model="fix_account['cffex_increase']" size="small" style="width: 20%;"placeholder="cffex_increase"></el-input>
							<span style="width: 10%; padding-left: 5%; color: orange;">{{fix_account['cffex_proportion']}}%</span>
						</div>
						<div style="display: flex;align-items: center;center;padding-top: 20px; justify-content:center;">
							<span style="width: 20%;">commodity_increase_per：</span>
							<el-input v-model="fix_account['commodity_increase_per']" size="small" style="width: 20%;"placeholder="commodity_increase_per"></el-input>
							<span style="width: 20%; padding-left: 5%;">commodity_increase：</span>
							<el-input v-model="fix_account['commodity_increase']" size="small" style="width: 20%;"placeholder="commodity_increase"></el-input>
							<span style="width: 10%; padding-left: 5%; color: orange;">{{fix_account['commodity_proportion']}}%</span>
							
						</div>
						<div style="display: flex;align-items: center;center;padding-top: 20px; justify-content:center;">
							<span style="width: 20%;">stock_increase_per：</span>
							<el-input v-model="fix_account['stock_increase_per']" size="small" style="width: 20%;"placeholder="stock_increase_per"></el-input>
							<span style="width: 20%; padding-left: 5%;">stock_increase：</span>
							<el-input v-model="fix_account['stock_increase']" size="small" style="width: 20%;"placeholder="stock_increase"></el-input>
							<span style="width: 10%; padding-left: 5%; color: orange;">{{fix_account['stock_proportion']}}%</span>
						</div>
						<div style="display: flex;align-items: center;center;padding-top: 20px; justify-content:center;">
							<span style="width: 20%;">future_increase_per：</span>
							<el-input v-model="fix_account['future_increase_per']" size="small" style="width: 20%;"placeholder="future_increase_per"></el-input>
							<span style="width: 20%; padding-left: 5%;">future_increase：</span>
							<el-input v-model="fix_account['future_increase']" size="small" style="width: 20%;"placeholder="future_increase"></el-input>
							<span style="width: 10%; padding-left: 5%; color: orange;">{{fix_account['future_proportion']}}%</span>
						</div>
						<div style="display: flex;align-items: center;center;padding-top: 20px; justify-content:center;">
							<span style="width: 20%;">product_total_increase_per：</span>
							<el-input v-model="fix_account['product_total_increase_per']" size="small" style="width: 20%;"placeholder="product_total_increase_per"></el-input>
							<span style="width: 20%; padding-left: 5%;">product_total_increase：</span>
							<el-input v-model="fix_account['product_total_increase']" size="small" style="width: 20%;"placeholder="product_total_increase"></el-input>
							<span style="width: 10%; padding-left: 5%; color: orange;"> </span>
						</div>
						<div style="display: flex ;align-items: center; padding-top: 20px;">
						<el-button size="mini" type="primary" @click="add_fix()">相加 </el-button>
						</div>
						<div style="display: flex ;align-items: center; padding-top: 20px;">
							<span style="flex: 1; ">lock_aum：{{fix_account['lock_aum']}}</span>
							<span style="flex: 1;  ">zcjz_sum：{{fix_account['zcjz_sum']}}</span>
							<span style="flex: 1;  ">sszb_sum：{{fix_account['sszb_sum']}}</span>
							<span style="flex: 1;  ">ljdwjz_increase_per：{{fix_account['ljdwjz_increase_per']}}</span>
							<span style="flex: 1;  ">index_increase：{{fix_account['index_increase']}}</span>
						</div>
						<div style="display: flex;align-items: center;center;padding-top: 20px; justify-content:center;">
							<span style="flex: 1; ">cffex_list：{{fix_account['cffex_list']}}</span>
							<span style="flex: 1; ">future_list：{{fix_account['future_list']}}</span>
							<span style="flex: 1; ">commodity_list：{{fix_account['commodity_list']}}</span>
							<span style="flex: 1; ">bond_list：{{fix_account['bond_list']}}</span>
							<span style="flex: 1; ">stock_list：{{fix_account['stock_list']}}</span>
						</div>
						
						
						
					</div>
					
				</div>
				<div style="display: flex;align-items: center;padding-top: 20px;  justify-content:center">
					<el-button style=" height: 33px;" size="small" type="success" @click="changedata_account()">修改确认</el-button>
				
					<el-button style=" height: 33px;" size="small" type="primary" @click="cal_again()">重新计算</el-button>
				</div>
		
			</div>
		
		
		</el-dialog>
	</div>
</template>

<script>
	import headTop from '@/components/headTop'
	export default {
		data() {
			return {
				in_use_flag:true,
				checkflag: false,
				core_pos: [],
				product_choice_list:[],
				pos_index_item: '',
				product_choice: "",
				product_options: [],
				target_pos_index_options: [],
				date_choice: "",
				
				date_choice_end: "",
				date_choice_begin: "",
				date_options: [],
				tableData: [],
				currentRow: null,
				inoutflag:false,
				count: 0,
				exchange_detail: [],
				LP_account_list: [],
				fix_account: {},
				visible: false,
				visible2: false,
				screenWidth: document.body.clientWidth, // 屏幕尺寸
				screenHeight: document.body.clientHeight, // 屏幕尺寸
				moneyindex: "0",
				arrange_data: [],
				arrange_data1: [],
				strategy_total_asset:0,
				
			
				
			
				
				use_options: [
					{
						value: 'yes',
						label: 'yes'
					},
					{
						value: 'no',
						label: 'no'
					},

				],

			}
		},
		components: {
			headTop,
		},



		activated() {

			// console.log("当前登入用户", this.$store.state.adminInfo.name);
			//    if (this.tradesysPermission_list.indexOf (this.$store.state.adminInfo.permission) ==-1) {
			// 	console.log(this.$store.state.adminInfo.name,"未登入")
			// 	this.$message({type: 'error',	message: '没有权限',});
			// 	this.$router.push({
			// 		path: `/manage`
			// 	})
			// }
		},
		created() {
			
			this.get_exchange_arrange()
			this.get_date_last()
			this.get_product_list()
		},
		computed: {
			
		},

		methods: {
			
			handleSelectionChange(val) {
				this.multipleSelection = val;
				let total_asset=0;
				for(let i=0;i<this.multipleSelection.length;i++){
					// console.log(this.multipleSelection[i].total_asset) 	
					total_asset+= this.multipleSelection[i].total_asset
				}
				this.strategy_total_asset=total_asset
				// console.log(total_asset)
							
			},
			add_fix(){
			    this.fix_account['product_total_increase_per'] = 
			    parseFloat(this.fix_account['bond_increase_per'] || 0) +
			    parseFloat(this.fix_account['commodity_increase_per'] || 0) +
			    parseFloat(this.fix_account['stock_increase_per'] || 0) +
			    parseFloat(this.fix_account['future_increase_per'] || 0) +
			    parseFloat(this.fix_account['cffex_increase_per'] || 0);
				// this.fix_account['product_total_increase']=this.fix_account['bond_increase']+this.fix_account['commodity_increase']
				// +this.fix_account['stock_increase']+this.fix_account['future_increase']+this.fix_account['cffex_increase']
				this.fix_account['product_total_increase_per']=this.fix_account['product_total_increase_per'].toFixed(3);
				// this.fix_account['product_total_increase']=this.fix_account['product_total_increase'].toFixed(2);
			},
			handlefixaccount(index, row) {
				console.log("row", row)
				this.fix_account = row
				this.visible2 = true
			},
			get_date_last() {
				var that = this;
				
				
				let sql =
					" select distinct date_format(date,'%Y-%m-%d') as date_str  from `LP_account_day` where date>'20250101' order by date_str desc;"
				that.$axios.post(that.lpapi2, "form=get_data&sql_source=yxk&sql=" + sql).then(response => {
					console.log(response, 'data_tradesys_account');
					if (response.status = 200) {
						that.date_options = []
						that.date_choice_begin=response.data[0]['date_str']
						//for (var i = 0; i < response.data.length; i++) {
						for (var i =0; i <=response.data.length; i++) {
							let char = {
								value: response.data[i]['date_str'],
								label: response.data[i]['date_str'],
							};
							that.date_options.push(char);
						}
					} else {
						console.log(response.data.statusCode);
					}
				})
			
			},
			send_xls(){
				var that = this;
			
				const data = {
				    module_name: "yxk_tool.get_xls_data",
				    function_name: "update_file_day",
				    args: [],
				    kwargs: {'send_flag':'true'}
				};
				
				that.$axios.post(that.lpcallfunction,data).then(response => {
					console.log(response, 'data_tradesys_account');
					if (response.status = 200) {
						that.$message({
							type: 'success',
							message: '完成'
						});
					} else {
						console.log(response.data.statusCode);
						that.$message({
							type: 'error',
							message: '报错'
						});
					}
				})
							
				
			},
			get_product_list() {
				var that = this;
				
				
				let sql =
					" select distinct product_name  from `config_product`  order by product_name desc;"
				that.$axios.post(that.lpapi2, "form=get_data&sql_source=yxk&sql=" + sql).then(response => {
					console.log(response, 'data_tradesys_account');
					if (response.status = 200) {
						that.product_options = []
						//for (var i = 0; i < response.data.length; i++) {
						for (var i =0; i <=response.data.length; i++) {
							let char = {
								value: response.data[i]['product_name'],
								label: response.data[i]['product_name'],
							};
							that.product_options.push(char);
						}
					} else {
						console.log(response.data.statusCode);
					}
				})
			
			},
		
		
		
		
		
		
		
		
			get_exchange_arrange1() {
				var that = this;
				console.log(that.date_choice_begin)
				if (this.date_choice_begin == "" || this.date_choice_end == "") {
					return
				}
			
			let account_state="a.product_name in ("
			let str1=""
			for (var i = 0; i < that.product_choice_list.length; i++) {
				let str1="'"+that.product_choice_list[i]+"',"
				account_state+=str1
			}
			account_state=account_state.substr(0, account_state.length-1); 
			
			account_state+=") and"
			if (that.product_choice_list.length==0){
				account_state=""
				
			}
			
			let sql = " SELECT  a.product_name, b.product_properties,SUM(a.bond_increase) AS bond_increase, SUM(a.cffex_increase) AS cffex_increase, \
	SUM(a.commodity_increase) AS commodity_increase,  SUM(a.stock_increase) AS stock_increase, SUM(a.future_increase) AS future_increase,\
	SUM(a.bond_increase_per) AS bond_increase_per, SUM(a.cffex_increase_per) AS cffex_increase_per,  SUM(a.commodity_increase_per) AS commodity_increase_per,\
	SUM(a.stock_increase_per) AS stock_increase_per, SUM(a.future_increase_per) AS future_increase_per \
    FROM   LP_fund_value_day a JOIN  config_product b ON a.product_name = b.product_name \
    WHERE  "+account_state+" b.in_use = 'yes' AND a.date >= '" + this.date_choice_begin + "' AND a.date <= '" + this.date_choice_end + "' \
    GROUP BY  a.product_name, b.product_properties  ORDER BY   b.product_properties"
				
			
				that.arrange_data1 = []
				that.$axios.post(that.lpapi2, "form=get_data&sql_source=yxk&sql=" + sql).then(response => {
			
					console.log(response.data[0], 'LP_fund_value_day')
			
					if (response.status = 200) {
						if (response.data[0].hasOwnProperty('message')) {
							that.arrange_data1 = []
						} else {
							that.arrange_data1 = response.data;
						}
						// that.arrange_data = response.data;
					} else {
						console.log(response.data.statusCode);
					}
				})
			
			
			},
		
		
		
		
			get_exchange_arrange() {
				var that = this;
				console.log(that.lpapi2)
				let sql = " select b.product_properties, a.* ,date_format(a.date,'%Y-%m-%d') as date_str  from \
				LP_fund_value_day a, config_product b \
				where a.product_name=b.product_name and b.in_use='yes' and a.date  =  CURDATE()	 order by b.product_properties;"
				if (this.date_choice_begin != "") {
					 sql = " select b.product_properties, a.* ,date_format(a.date,'%Y-%m-%d') as date_str  from \
					 LP_fund_value_day a, config_product b \
					 where a.product_name=b.product_name and b.in_use='yes' and a.date  =  '"+this.date_choice_begin+"'	 order by b.product_properties;"
				} 
				if ( this.product_choice != "") {
					sql = " select b.product_properties, a.* ,date_format(a.date,'%Y-%m-%d') as date_str  from \
					LP_fund_value_day a, config_product b \
					where a.product_name=b.product_name and b.in_use='yes' and a.date >=  '"+this.date_choice_begin+"' and a.date <=  '"+this.date_choice_end+"' and a.product_name  =  '"+this.product_choice+"'	 ;"
					
			   }
				that.arrange_data = []
				that.$axios.post(that.lpapi2, "form=get_data&sql_source=yxk&sql=" + sql).then(response => {

					console.log(response.data[0], 'LP_fund_value_day')

					if (response.status = 200) {
						if (response.data[0].hasOwnProperty('message')) {
							that.arrange_data = []
						} else {
							that.arrange_data = response.data;
							
							that.arrange_data = that.arrange_data.map(row => ({
							  ...row,
							  difference: parseFloat((row.product_total_increase_per - row.ljdwjz_increase_per).toFixed(2))
							}));
							
						}
						// that.arrange_data = response.data;
					} else {
						console.log(response.data.statusCode);
					}
				})


			},
			cal_again(){
				var that=this
				that.$confirm('此操作将永久修改数据, 是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',inputType: 'password',
					type: 'warning'
				}).then(() => {
					let fixdata=that.fix_account
					const data = {
						module_name: "yxk_tool.product_jinzhi",
						function_name: "predict_product_data",
						args: [],
						kwargs: {'send_flag':'false','choicedate': fixdata['date_str'],'choiceProduct':fixdata['product_name']}
					};
					
					that.$axios.post(that.lpcallfunction,data).then(response => {
					// that.$axios.post(that.lpapi2, "form=do_sql&table=LP_account_list&updata="+ jsonStr).then(response => {
						if (response.status = 200) {
							that.$message({
								type: 'success',
								message: '修改成功!',
							});
							that.visible2 = false;
							that.get_exchange_arrange();
							that.$forceUpdate();
						} else {
							that.visible2 = false;
							that.$message({
								showClose: true,
								message: response.data,
								duration: 4000,
								type: 'error'
							});
						}
					})
					
					}).catch(() => {
						that.$message({
							type: 'info',
							message: '已取消修改'
						});
					});
				
			},

			changedata_account(){
				var that = this
				if (this.allow_readpw!='yes' ){
					this.$prompt('请输入密码', '提示', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',inputType: 'password',
						inputType: 'password',
					}).then(({
						value
					}) => {
						if (value == '621890') {
							this.$message({
								type: 'success',
								message: '密码正确:'
							});
							that.allow_readpw='yes'
						} else {
							this.$message({
								type: 'error',
								message: '密码出错'
							});
						}
					}).catch(() => {
						this.$message({
							type: 'info',
							message: '取消输入'
						});
					});
					return
				}
				
				that.$confirm('此操作将永久修改数据, 是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',inputType: 'password',
					type: 'warning'
				}).then(() => {
					let fixdata=that.fix_account
			
					
					
				
					
					let sql3 = "UPDATE `LP_fund_value_day` SET \
						`bond_increase_per` = '" + fixdata['bond_increase_per'] + "', \
						`cffex_increase_per` = '" + fixdata['cffex_increase_per'] + "',  \
						`commodity_increase_per` = '" + fixdata['commodity_increase_per'] + "',  \
						`stock_increase_per` = '" + fixdata['stock_increase_per'] + "',  \
						`future_increase_per` = '" + fixdata['future_increase_per'] + "',  \
						`bond_increase` = '" + fixdata['bond_increase'] + "',  \
						`cffex_increase` = '" + fixdata['cffex_increase'] + "',  \
						`commodity_increase` = '" + fixdata['commodity_increase'] + "',  \
						`stock_increase` = '" + fixdata['stock_increase'] + "'  ,\
						`product_total_increase_per` = '" + fixdata['product_total_increase_per'] + "'  \
						WHERE `product_name` = '" + fixdata['product_name'] + "' and date='" + fixdata['date_str'] + "' ;"
					
					// var jsonStr = JSON.stringify(fixdata);
					that.$axios.post(that.lpapi2, "form=do_sql&sql_source=yxk&sql=" + sql3).then(response => {
					// that.$axios.post(that.lpapi2, "form=do_sql&table=LP_account_list&updata="+ jsonStr).then(response => {
						if (response.status = 200) {
							that.$message({
								type: 'success',
								message: '修改成功!',
							});
							that.visible2 = false;
							that.get_exchange_arrange();
							that.$forceUpdate();
						} else {
							that.visible2 = false;
							that.$message({
								showClose: true,
								message: response.data,
								duration: 4000,
								type: 'error'
							});
						}
					})
				
				}).catch(() => {
					that.$message({
						type: 'info',
						message: '已取消修改'
					});
				});
				
				
				
				
			},

		
			
			tableRowClassNamemoneyout({
				row,
				rowIndex
			}) {
		
				if (this.arrange_data[rowIndex]['status'] == '待处理' | this.arrange_data[rowIndex]['status'] == '准备' ) {
					return 'bacorange';
				}
				if (this.arrange_data[rowIndex]['status'] == '异常') {
					return 'bacOrangeRed';
				}
				return '';
			}

		},
	}
</script>

<style>
	.el-table .bacOrangeRed {
		background: OrangeRed;
	}

	.el-table .bacorange {
		background: orange;
	}

	.el-table .success-row {
		background: grey;
		color: white;
	}

	.table_container {
		margin: 20px 5%;
		/* background-color: #0000FF; */
	}

	.el-table .grey {
		background: Silver;
	}

	.el-table .DarkGray {
		background: DarkGray;
	}

	.el-table .LightCoral {
		background: LightCoral;
		color: white;
	}

	.el-table .LimeGreen {
		background: LimeGreen;
	}

	.el-table .green {
		background: green;
	}

	.el-table .LightSlateGray {
		background: LightSlateGray;
	}

	.el-table .red {
		background: red;
		color: white;
	}

	.el-table .orange {
		background: NavajoWhite;
		color: black;
	}

	.el-table .blue {
		background: blue;
	}

	.el-table .purple {
		background: Violet;
		color: black;
	}

	.el-table .LightSteelBlue {
		background: LightSteelBlue;
	}

	.el-table .Goldenrod {
		background: Goldenrod;
	}

	.el-table .xingmu {
		background: Goldenrod;
		color: red;
		font-weight: bold;

	}


	.el-table .black {
		background: black;
		color: white;
	}

	.el-table .green {
		background: green;
		color: white;
	}

	.el-table .CornflowerBlue {
		background: CornflowerBlue;
		color: white;
	}

	.el-table .DodgerBlue {
		background: DodgerBlue;
	}
</style>
